//c++实现二叉树
//二叉链表存储结构
#include<binary_tree.hpp>

int main()
{
   ListData a,b,c,d;
   a.init();
   b.init();
   c.init();
   d.init();
   BinaryTree* binaryTree1=new BinaryTree(a);
   //insert test
   binaryTree1->Insert(b);
   binaryTree1->Insert(c);
   binaryTree1->Insert(d);


   //traverse
   std::cout<<"preOrder:";
   binaryTree1->PreOrderTraverse();  
   std::cout<<"InOrder:";
   binaryTree1->InOrderTraverse();
   std::cout<<"postOrder:";
   binaryTree1->PostOrderTraverse();
   std::cout<<"levelOrder:";
   binaryTree1->LevelOrderTraverse();
   
   //depth
   std::cout<<"depth is:\n"<<binaryTree1->GetDepth()<<"\n";

   //node
   std::cout<<"the number of node is:\n"<<binaryTree1->NodeCount()<<"\n";

   //lead
   std::cout<<"the number of lead is:\n"<<binaryTree1->LeadCount()<<"\n";


   //delete
   binaryTree1->Delete(b);

   //destroy
   delete binaryTree1;
    return 0;
}